from itertools import count

def prime(n):
    for i in range(2, (n // 2) + 1):
        if n % i == 0:
            return False
    else:
        return True

def prime_closest_to(n):
    for i in count(n):
        if prime(i):
            x = i
            dx = x - n
            break
    for j in count(n - 1, 1):
        if prime(j):
            y = j
            dy = n - y
            break
    ret = x if dx < dy else y
    return ret

a = input("введите три слова через пробел").split()
print(a)
b = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"]
print(b)
chislo = 0
for i in a:
    for j in range(0, 10):
        if i == b[j]:
            chislo = (chislo + j)*10
chislo = chislo // 10
print (chislo)
if chislo < 100 or chislo > 999:
    print("Wrong_input")
else:
    print("Ближайшее простое число =", prime_closest_to(chislo))
